
<?php

$g_mocool_dbconn;
$g_mocool_redis;

function dal_mocool_get_dbconn()
{
	global $g_mocool_dbconn;
	
	if (isset($g_mocool_dbconn))
		return $g_mocool_dbconn;
	
	$g_mocool_dbconn = dal_getconn($GLOBALS['g_dal_mocool_dbstr']);
	return $g_mocool_dbconn;
}

function dal_mocool_get_redis()
{
	global $g_mocool_redis;
	
	if (isset($g_mocool_redis))
		return $g_mocool_redis;
	
	$g_mocool_redis = dal_getconn($GLOBALS['g_dal_mocool_redis']);
	return $g_mocool_redis;
}

function dal_mocool_user_dbconn($user_id)
{
	return dal_mocool_get_dbconn();
}

?>
